<?php
use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use frontend\assets\AppAsset;
use yii\widgets\LinkPager;
use frontend\controllers\AboutController;
use common\models\member\Member;
use common\models\category\Category;
use common\models\articles\Articles;
use common\models\art\Art;
use common\models\Fenhuigrade\Fenhuigrade;

    $fenhui = Fenhuigrade::find()->where(['status' => Fenhuigrade::STATUS_ACTIVE])->asArray()->limit(6)->all();
    $weiyuan = Articles::find()->where(['category_id' => 16, 'status' => Articles::STATUS_ACTIVE])->asArray()->limit(3)->all();
    $pinpai = Articles::find()->where(['category_id' => 23, 'status' => Articles::STATUS_ACTIVE])->asArray()->limit(9)->all();
?>
    <style>
        .divtoneulimg{
            margin-right: -33px;
        }
        .divtoneulimg li{
            margin-right: 36px;
        }
        .xhnewlist{
            width: 100%;
            height: auto;
        }
        .xhnewlist li{
            width: 100%;
            padding: 15px 0;
        }
        .xhnewlist li:last-child{
            border-bottom: none;
        }
        .divtoneul{
            height: auto;
        }



    </style>

    <div class="content">
        <div class="w1200 clearFloat mb50">
            <h3 class="abouth3">当前位置：<a href="<?= yii\helpers\Url::to(['/']);?>">首页</a> > <a href="<?= yii\helpers\Url::to([$parentinfo['type'], 'id'=>$parentid]);?>"><?= $parenttitle;?></a> > <a><?= $title;?></a></h3>
            <div class="clearFloat">
                <div class="jjleft floatLeft">
                    <div class="clearFloat">
                        <h3 class="jjtitle"><?= $parenttitle;?></h3>
                        <ul class="jjul">
                            <?php foreach($childcat as $t){ ?>
                            <li<?php if($id == $t['id']){echo ' class="jjactive"';} ?>>
                                <a href="
                                <?php if(!empty($t['type'])) {
                                    echo yii\helpers\Url::to([$t['type'], 'id' => $t['id']]);
                                } else{ 
                                    echo yii\helpers\Url::to([$t['ctype'], 'id' => $t['id']]);
                                } ?>
                                ">
                                    <?php echo $t['name']; ?>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>
                    </div>
                </div>
                <div class="jjmiddle floatLeft">
                    <div class="clearFloat">
                        <ul class="xhnewlist clearFloat">
                            <?php foreach($articles as $t) { ?>
                            <li>
                                
                                <a href="<?= yii\helpers\Url::to(['list/membercontent', 'id' => $t['id']]); ?>">
                                    <img src="/upload/<?= json_decode($t['faceimg'], true)['newname'];?>" alt="" width="77" height="77"
                                         class="floatLeft mr15" style="border: 1px solid #dddddd">
                                    <h3 class="newh3"><?= $t['company'];?></h3>
                                    <span class="newspan">
                                        <?= mb_substr(strip_tags($t['description']),0,73,'utf-8'); ?><?php if(strlen($t['description']) > 219) { echo '...'; } ?>
                                    </span>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>
                        <div class="newpage mt50 mb50">
                                <?php if($page)
                                {
                                    echo LinkPager::widget([
                                    'maxButtonCount' => 6,
                                    'prevPageLabel' =>'&lt;',
                                    'nextPageLabel' =>'&gt;',
                                    'pagination'=>$page,
                                ]);
                                }
                                ?>
                        </div>
                    </div>
                </div>
                <div class="jjright floatRight">
                    <div class="clearFloat">
                        <h3 class="indexh3"><span>协会机构 </span></h3>
                        <ul class="divtoneulimg clearFloat">
                            <?php foreach($fenhui as $vo) { ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['content/fenhui','id' => $vo['id']]); ?>">
                                    <img src="/upload/<?= json_decode($vo['label_img'], true)['newname'];?>" alt="" width="72" height="72">
                                    <span><?= mb_substr(strip_tags($vo['name']),0,5,'utf-8'); ?><?php if(strlen($vo['name']) > 16) { echo '...'; } ?></span>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>
                    </div>
                    <div class="clearFloat mt35">
                        <h3 class="indexh3"><span>分支机构</span></h3>
                        <ul class="fzdiv mt35">
                            <?php foreach($weiyuan as $t) { ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $t['id']]); ?>">
                                    <?= mb_substr(strip_tags($t['title']),0,11,'utf-8'); ?><?php if(strlen($t['title']) > 34) { echo '...'; } ?>
                                </a>
                            </li>
                            <?php } ?>
                        </ul>
                    </div>
                    <div class="clearFloat mt35">
                        <h3 class="indexh3"><span>品牌建设</span></h3>
                        <ul class="divtoneul">
                           <?php foreach($pinpai as $vo){ ?>
                            <li>
                                <a href="<?= yii\helpers\Url::to(['list/newscontent','id' => $vo['id']]); ?>"><?= mb_substr(strip_tags($vo['title']),0,22,'utf-8'); ?><?php if(strlen($vo['title']) > 67) { echo '...'; } ?></a>
                            </li>
                          <?php } ?>
                        </ul>
                    </div>
                </div>

            </div>
        </div>
    </div>